
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 800px;
            height: 300px;
            background-color: rgb(96, 98, 98);
            
            /* 1.在父元素中设置flex布局 */
            display: flex;
            
            /* flex-flow ==  flex-direction: row; + flex-wrap: nowrap;*/
            /* flex-flow: row; */
            flex-direction: row;
            flex-wrap: nowrap;
            /* 2.默认设置主轴方向为x轴 */
            /* flex-direction: row; */

            /* 3.flex布局元素换行，如果装不下会缩小子元素的宽度放在父元素中 */
            /* flex-wrap: wrap; */

            /* 4.设置主轴的元素排列 先贴边再均分 */
            justify-content: space-between;
        }
        div span:nth-child(1){
            border: 1px solid #ffffff;
            width: 100px;
            height: 100px;
            background-color: rgb(109, 140, 140);
        }
        /* 第一个盒子宽度固定，第三个盒子宽度固定，第二个盒子自适应 */
        div span:nth-child(2){
            flex: 1;
            background-color: rgb(50, 146, 146);
            height: 100px;
            border: 1px solid #ffffff;

        }
        div span:nth-child(3){
            border: 1px solid #ffffff;
            width: 100px;
            height: 100px;
            background-color: rgb(109, 140, 140);
        }



        /* 一个盒子平均分 */
        p {
            width: 800px;
            height: 200px;
            background-color: rgb(96, 98, 98);
            
            /* 1.在父元素中设置flex布局 */
            display: flex;
            
            /* flex-flow ==  flex-direction: row; + flex-wrap: nowrap;*/
            /* flex-flow: row; */
            flex-direction: row;
            flex-wrap: nowrap;
            /* 2.默认设置主轴方向为x轴 */
            /* flex-direction: row; */

            /* 3.flex布局元素换行，如果装不下会缩小子元素的宽度放在父元素中 */
            /* flex-wrap: wrap; */

            /* 4.设置主轴的元素排列 先贴边再均分 */
            justify-content: space-between;
        }
        p span{
            flex: 3;
            height: 100px;
            background-color: pink;
            border: 1px solid #ffffff;
        }
    </style>
</head>
<body>
    <div>
        <span>1</span>
        <span>2</span>
        <span>3</span>
        <!-- <span>4</span>
        <span>5</span>
        <span>6</span> -->
    </div>

    <p>
        <span></span>
        <span></span>
        <span></span>
    </p>
</body>
</html>